package org.apache.servicecomb.fence.resource;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.huaweicloud.common.context.InvocationContextHolder;

@RestController
public class AuthController {

  @Autowired
  private AuthFeign authFeign;

  @Autowired
  private DiscoveryClient discoveryClient;

  @PostMapping(path = "/v1/token")
  public Map load(@RequestBody Map<String, String> parameters) {

    return authFeign.grantToken(parameters);
  }
}
